3.256 \(\int \sqrt{1+\sec ^2(x)} \, dx\)

Optimal. Leaf size=24 \[ \tan ^{-1}\left (\frac{\tan (x)}{\sqrt{\tan ^2(x)+2}}\right )+\sinh ^{-1}\left (\frac{\tan (x)}{\sqrt{2}}\right ) \]

[Out]

ArcSinh[Tan[x]/Sqrt[2]] + ArcTan[Tan[x]/Sqrt[2 + Tan[x]^2]]

________________________________________________________________________________________

Rubi [A]  time = 0.0185345, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {4128, 402, 215, 377, 203} \[ \tan ^{-1}\left (\frac{\tan (x)}{\sqrt{\tan ^2(x)+2}}\right )+\sinh ^{-1}\left (\frac{\tan (x)}{\sqrt{2}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[1 + Sec[x]^2],x]

[Out]

ArcSinh[Tan[x]/Sqrt[2]] + ArcTan[Tan[x]/Sqrt[2 + Tan[x]^2]]

Rule 4128

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[(a + b + b*ff^2*x^2)^p/(1 + ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p},
 x] && NeQ[a + b, 0] && NeQ[p, -1]

Rule 402

Int[((a_) + (b_.)*(x_)^2)^(p_.)/((c_) + (d_.)*(x_)^2), x_Symbol] :> Dist[b/d, Int[(a + b*x^2)^(p - 1), x], x]
- Dist[(b*c - a*d)/d, Int[(a + b*x^2)^(p - 1)/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d,
0] && GtQ[p, 0] && (EqQ[p, 1/2] || EqQ[Denominator[p], 4])

Rule 215

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[(Rt[b, 2]*x)/Sqrt[a]]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 377

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{1+\sec ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{\sqrt{2+x^2}}{1+x^2} \, dx,x,\tan (x)\right )\\ &=\operatorname{Subst}\left (\int \frac{1}{\sqrt{2+x^2}} \, dx,x,\tan (x)\right )+\operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right ) \sqrt{2+x^2}} \, dx,x,\tan (x)\right )\\ &=\sinh ^{-1}\left (\frac{\tan (x)}{\sqrt{2}}\right )+\operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\frac{\tan (x)}{\sqrt{2+\tan ^2(x)}}\right )\\ &=\sinh ^{-1}\left (\frac{\tan (x)}{\sqrt{2}}\right )+\tan ^{-1}\left (\frac{\tan (x)}{\sqrt{2+\tan ^2(x)}}\right )\\ \end{align*}

Mathematica [B]  time = 0.0500783, size = 57, normalized size = 2.38 \[ \frac{\sqrt{2} \cos (x) \sqrt{\sec ^2(x)+1} \left (\sin ^{-1}\left (\frac{\sin (x)}{\sqrt{2}}\right )+\tanh ^{-1}\left (\frac{\sqrt{2} \sin (x)}{\sqrt{\cos (2 x)+3}}\right )\right )}{\sqrt{\cos (2 x)+3}} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[1 + Sec[x]^2],x]

[Out]

(Sqrt[2]*(ArcSin[Sin[x]/Sqrt[2]] + ArcTanh[(Sqrt[2]*Sin[x])/Sqrt[3 + Cos[2*x]]])*Cos[x]*Sqrt[1 + Sec[x]^2])/Sq
rt[3 + Cos[2*x]]

________________________________________________________________________________________

Maple [C]  time = 0.299, size = 190, normalized size = 7.9 \begin{align*}{\frac{ \left ( -1+i \right ) \cos \left ( x \right ) \left ( \sin \left ( x \right ) \right ) ^{2}}{ \left ( -1+\cos \left ( x \right ) \right ) \left ( \left ( \cos \left ( x \right ) \right ) ^{2}+1 \right ) } \left ( \left ( -1 \right ) ^{{\frac{3}{4}}}{\it EllipticPi} \left ({\frac{\sqrt [4]{-1} \left ( -1+\cos \left ( x \right ) \right ) }{\sin \left ( x \right ) }},i,i \right ) + \left ( -1 \right ) ^{{\frac{3}{4}}}{\it EllipticPi} \left ({\frac{\sqrt [4]{-1} \left ( -1+\cos \left ( x \right ) \right ) }{\sin \left ( x \right ) }},-i,i \right ) -\sqrt [4]{-1}{\it EllipticPi} \left ({\frac{\sqrt [4]{-1} \left ( -1+\cos \left ( x \right ) \right ) }{\sin \left ( x \right ) }},i,i \right ) -\sqrt [4]{-1}{\it EllipticPi} \left ({\frac{\sqrt [4]{-1} \left ( -1+\cos \left ( x \right ) \right ) }{\sin \left ( x \right ) }},-i,i \right ) +\sqrt{2}{\it EllipticF} \left ({\frac{ \left ({\frac{1}{2}}+{\frac{i}{2}} \right ) \sqrt{2} \left ( -1+\cos \left ( x \right ) \right ) }{\sin \left ( x \right ) }},i \right ) \right ) \sqrt{{\frac{ \left ( \cos \left ( x \right ) \right ) ^{2}+1}{ \left ( \cos \left ( x \right ) \right ) ^{2}}}}\sqrt{{\frac{i\cos \left ( x \right ) +1-i+\cos \left ( x \right ) }{\cos \left ( x \right ) +1}}}\sqrt{-{\frac{i\cos \left ( x \right ) -1-i-\cos \left ( x \right ) }{\cos \left ( x \right ) +1}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1+sec(x)^2)^(1/2),x)

[Out]

(-1+I)*((-1)^(3/4)*EllipticPi((-1)^(1/4)*(-1+cos(x))/sin(x),I,I)+(-1)^(3/4)*EllipticPi((-1)^(1/4)*(-1+cos(x))/
sin(x),-I,I)-(-1)^(1/4)*EllipticPi((-1)^(1/4)*(-1+cos(x))/sin(x),I,I)-(-1)^(1/4)*EllipticPi((-1)^(1/4)*(-1+cos
(x))/sin(x),-I,I)+2^(1/2)*EllipticF((1/2+1/2*I)*2^(1/2)*(-1+cos(x))/sin(x),I))*cos(x)*sin(x)^2*((cos(x)^2+1)/c
os(x)^2)^(1/2)*((I*cos(x)+1-I+cos(x))/(cos(x)+1))^(1/2)*(-(I*cos(x)-1-I-cos(x))/(cos(x)+1))^(1/2)/(-1+cos(x))/
(cos(x)^2+1)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+sec(x)^2)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [B]  time = 0.526813, size = 444, normalized size = 18.5 \begin{align*} \frac{1}{2} \, \arctan \left (\frac{\sqrt{\frac{\cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} \cos \left (x\right )^{3} \sin \left (x\right ) + \cos \left (x\right ) \sin \left (x\right )}{\cos \left (x\right )^{4} + \cos \left (x\right )^{2} - 1}\right ) - \frac{1}{2} \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right )}\right ) + \frac{1}{2} \, \log \left (\cos \left (x\right )^{2} + \cos \left (x\right ) \sin \left (x\right ) +{\left (\cos \left (x\right )^{2} + \cos \left (x\right ) \sin \left (x\right )\right )} \sqrt{\frac{\cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} + 1\right ) - \frac{1}{2} \, \log \left (\cos \left (x\right )^{2} - \cos \left (x\right ) \sin \left (x\right ) +{\left (\cos \left (x\right )^{2} - \cos \left (x\right ) \sin \left (x\right )\right )} \sqrt{\frac{\cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+sec(x)^2)^(1/2),x, algorithm="fricas")

[Out]

1/2*arctan((sqrt((cos(x)^2 + 1)/cos(x)^2)*cos(x)^3*sin(x) + cos(x)*sin(x))/(cos(x)^4 + cos(x)^2 - 1)) - 1/2*ar
ctan(sin(x)/cos(x)) + 1/2*log(cos(x)^2 + cos(x)*sin(x) + (cos(x)^2 + cos(x)*sin(x))*sqrt((cos(x)^2 + 1)/cos(x)
^2) + 1) - 1/2*log(cos(x)^2 - cos(x)*sin(x) + (cos(x)^2 - cos(x)*sin(x))*sqrt((cos(x)^2 + 1)/cos(x)^2) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{\sec ^{2}{\left (x \right )} + 1}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+sec(x)**2)**(1/2),x)

[Out]

Integral(sqrt(sec(x)**2 + 1), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{\sec \left (x\right )^{2} + 1}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+sec(x)^2)^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(sec(x)^2 + 1), x)